﻿using Microsoft.AspNetCore.Mvc;
using yunbo.Model.SM;
using yunbo.Repositorys.SMRepositorys;

namespace yunbo.Controllers.SMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class WMS_LLCKController : Controller
    {
        WMS_LLCKRepository _wms_llckRepository = new WMS_LLCKRepository();
        [HttpGet("Getllck")]
        public IActionResult Getllck(int PageNumber, int PageSize)
        {
            var fYCXWMS_LLCK = _wms_llckRepository.GetFYCXWMS_LLCK(PageNumber, PageSize);
            return Ok(fYCXWMS_LLCK);
        }
        [HttpPost("Addllck")]
        public IActionResult Addllck(WMS_LLCK wMS_LLCK)
        {
            wMS_LLCK.create_time = DateTime.Now;
            wMS_LLCK.llck_zt = 1;
            bool ll = _wms_llckRepository.Addllck(wMS_LLCK)>0;
            return Ok(ll);
        }
        [HttpPut("UpdateWMS_LLCK")]
        public IActionResult UpdateWMS_LLCK(string code)
        {
            bool zt = _wms_llckRepository.UpZt(code) > 0;
            return Ok(zt);
        }
        [HttpGet("GetWMS_LLCK")]
        public IActionResult GetWMS_LLCK(string code)
        {
            WMS_LLCK wMS_LLCK = _wms_llckRepository.GetWMS_LLCK(code);
            return Ok(wMS_LLCK);
        }
    }
}
